package top.hspstudy.property.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import top.hspstudy.property.entity.User;
import top.hspstudy.property.entity.UserBo;
import top.hspstudy.property.service.UserService;
import top.hspstudy.property.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author asus
* @description 针对表【user】的数据库操作Service实现
* @createDate 2022-02-20 13:42:34
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{

    @Resource
    private UserMapper userMapper;

    @Override
    public void deleteByUsername(String username) {
        userMapper.deleteByUsername(username);
    }

    @Override
    public Integer getByUsername(String username) {
        Integer count =  userMapper.getByUsername(username);
        return count;
    }

    @Override
    public Integer getByUsernameAndPassword(UserBo ub) {
        Integer count =  userMapper.getByUsernameAndPassword(ub.getUsername(),ub.getPassword());
        return count;
    }
}




